<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
 <%@ include file="/common/query.jsp"%>
<%@ include file="/common/det.jsp"%>
<script>
        $(function(){
            init();
        });
        function init(){
            var setting = {};
            var url ="";
            var p_insert = false;
            var p_del = false;
            var productPackageId = getQueryStringByDecode("productPackageId");
            var columns = [
                {field:'id',title:'id',hidden:true},
                {field:'productName',title:'标题',require:true,
                    dialog:{
                        url:"${base}/product/all",
						width:"99%",
                        height:"99%",
                        select:function(iframe){
                            if(iframe.frames.length<1){
                                alert("请选择一件商品");
                                return false;
							}
                            var row = iframe.frames[1].getGridChecked();
                            if(row.length==0){
                                alert("请选择一件商品");
                                return false;
							}
                            row = row[0];
                            console.log(row);
							$('#crud-productId').val(row.id);
                            $('#crud-productName').val(row.name);
                            return true;
                        }
                    }
				},
                {field:'picUrls',title:'图片',type:"imgs",update:false,insert:false},
                {field:'quantity',title:'数量',require:true,defaultValue:1},
                {field:'unit',title:'单位',require:true,update:false,insert:false},
                {field:'productId',title:'productId',hidden:true,require:true},
                {field:'productPackageId',title:'productPackageId',defaultValue:productPackageId,hidden:true},
            ];
            url='/product/package/det/manager?productPackageId='+productPackageId;
            //setting.singleSelec	t = true;
            createQuery('body',columns,{pager:false,edit:true,searchBar:{hidden:true},add:true,del:true,heji:false},url);

        }

        function seeProductAttrValue() {
            var row = getGridSelected();
            window.parent.seeProductAttrValue(row);
        }
</script>
</head>
<body>
	  <div id="body"></div>
</body>
</html>